#include <iostream>
#include <algorithm>
using namespace std;
const int N = 200005;
int n, q, x, len;
struct zb{
	int l;
	int r;
	int idx;
};
struct zb a[N];
bool cmp (zb a, zb b){
	return a.l < b.l;
}
int erf(int x){
	int l = -1, r = len;
	int mid;
	while(l + 1< r){
		mid = (l + r) >> 1;
		if (x >= a[mid].l){
			l = mid;
		}
		else {
			r = mid;
		}
	}
	return l;  
}
int main(){
	cin >> n >> q;
	while(n--){
		cin >> a[len].l >> a[len].r;
		a[len].idx = len + 1;
		len++;
	}
	sort(a, a + len, cmp);
	while(q--){
		cin >> x;
		int idx = erf(x);
		if (a[idx].l <= x && a[idx].r >= x && idx != -1) cout << a[idx].idx << endl;
		else cout << -1 << endl;
		
	}

    return 0;
}


